home *** CD-ROM | disk | FTP | other *** search
- on calculatedepth
- global depthdisplay
- global clicktestcursor
- global demx
- global demy
- global demdepth
-
-
- --check the location of the clicktestcursor
- demx = sprite(clicktestcursor).locH
- demy = sprite(clicktestcursor).locV
-
- --adjust for the dual display offset
- demy = demy-768
-
- if demx > 0 and demy > 0 then
- --check the pixel value of the dem
- demImage = member("map_dem_bw").image.duplicate()
- demcolor = demImage.getPixel(demx, demy)
- demdepth = demcolor.green
-
- --the values for this model are 2798 (highest) and 702 (lowest)
- --this results in a range of 2096 meters
- --2096 / 255 = 8.2196
-
- --recaculate and adjust
- demdepth = float(float(demdepth)*8.2196)
- demdepth = (demdepth + 702.0)*3.28
-
- put "elevation"&integer(demdepth)&" ft" into member "depth_display"
- put ""&integer(demdepth)&" feet" into member "depth_display3"
- put "Current Elevation: "&integer(demdepth)&" feet" into member "depth_display2"
- put ""&integer(demdepth-8395)&" ft" into member "depth_display3"
- put ""&integer(demdepth-7505)&" ft" into member "depth_display4"
-
- if sprite(clicktestcursor).locH < 1050 then
- sprite(depthdisplay).locH = sprite(clicktestcursor).locH+20
- sprite(depthdisplay-1).locH = sprite(clicktestcursor).locH+20+50
-
- end if
- if sprite(clicktestcursor).locH > 1049 then
- sprite(depthdisplay).locH = sprite(clicktestcursor).locH-35
- sprite(depthdisplay-1).locH = sprite(clicktestcursor).locH-35+50
-
- end if
- if sprite(clicktestcursor).locH > 2000 then
- sprite(depthdisplay).locH = sprite(clicktestcursor).locH-80
- sprite(depthdisplay-1).locH = sprite(clicktestcursor).locH-80+50
- end if
-
- if sprite(clicktestcursor).locV < 60 then
- sprite(depthdisplay).locV = sprite(clicktestcursor).locV+30
- sprite(depthdisplay-1).locV = sprite(clicktestcursor).locV+30+30
- end if
- if sprite(clicktestcursor).locV > 59 then
- sprite(depthdisplay).locV = sprite(clicktestcursor).locV-70
- sprite(depthdisplay-1).locV = sprite(clicktestcursor).locV-70+30
- end if
-
-
-
- end if
-
-
-
- end
-
-
-
-